"""
迭代器
"""
class Power():
    def __init__(self,n):
        self.__n=n
        self.__count=0
    def __iter__(self):
        return self
    def __next__(self):
        if self.__count<=self.__n:
            c=self.__count
            self.__count+=1
            return pow(3,c)
        raise StopIteration
    def Power(n):
        count=0
        while count<=n:
            yield pow(3,count)
            count+=1

n=int(input())
p=Power(n)
for i in p:
    print(i)
